﻿using System;

namespace YourLastOptionsDialog.Core.Attributes
{
    /// <summary>
    /// An option attribute that represents a floating point option (<see cref="decimal"/>, <see cref="double"/> or <see cref="float"/>).
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public sealed class OptionFloatAttribute : OptionAttribute
    {
        private double _minimum = double.MinValue;

        private double _maximum = double.MaxValue;

        /// <summary>
        /// Gets or sets the minimum allowed value for this option.
        /// The default is <see cref="double.MinValue"/>.
        /// </summary>
        public double Minimum
        {
            get
            {
                return _minimum;
            }

            set
            {
                _minimum = value;
            }
        }

        /// <summary>
        /// Gets or sets the maximum.
        /// The default is <see cref="double.MaxValue"/>.
        /// </summary>
        public double Maximum
        {
            get
            {
                return _maximum;
            }

            set
            {
                _maximum = value;
            }
        }

        /// <summary>
        /// Gets or sets the validation error message that is used if the value is outside the configured 
        /// minimum or maximum bounds, or if the user enters a string that cannot be converted to a floating point value.
        /// </summary>
        public string ValidationErrorMessage
        {
            get;
            set;
        }
    }
}